package com.gxar.quick.ar.server.base.common.enums.protocol;

import com.fasterxml.jackson.annotation.JsonCreator;
import lombok.Getter;

import java.util.Arrays;
import java.util.Optional;

/**
 * AR设备等级
 *
 * @author zxh
 * @version 1.0
 * @created 2024/02/23.
 */
@Getter
public enum ArDeviceLevelEnum {
    
    HIGH("high", "高性能"),
    MEDIUM("medium", "中性能"),
    LOW("low", "低性能"),

    ;

    private final String name;
    private final String desc;

    ArDeviceLevelEnum(String name, String desc) {
        this.name = name;
        this.desc = desc;
    }

    @JsonCreator
    public static ArDeviceLevelEnum getByName(String name) {
        Optional<ArDeviceLevelEnum> targetEnum = Arrays.stream(ArDeviceLevelEnum.values()).filter(e -> e.getName().equals(name)).findFirst();
        return targetEnum.orElse(null);
    }
}
